def signal(*args):
    # Bias
    df = args[0]
    n = args[1]
    diff_num = args[2]
    factor_name = args[3]

    ma = df['close'].rolling(n, min_periods=1).mean()
    df[factor_name] = (df['close'] / ma - 1).ewm(n, adjust=False).mean()

    if diff_num > 0:
        raise NotImplementedError('暂不支持diff_num，请在因子内添加add_diff相关逻辑')
    else:
        return df
